<form action="" method="post" enctype="multipart/form-data" id="form">
<?php echo $this->form()->hidden('referer', $this->referer) . "\n";?>
<?php if(!$this->step) { ?>
<?php 
$this->headLink()->prependStylesheet(_STATIC_HTTP . '/admin/css/photoBox.css');
$this->headScript()->appendFile(_STATIC_HTTP . '/jquery/swfupload.js');
$this->headScript()->appendFile(_STATIC_HTTP . '/admin/js/upload.js');
$this->headScript()->appendFile(_STATIC_HTTP . '/jquery/json2.js');
?>
<?php $this->headScript()->captureStart();?>
$(document).ready(function() {
	_upload.setting = {
		preview_url: '<?php echo resource_config_image::http(true);?>/',
		form_name: 'form',
		upload_type: 'image',
		upload_sid: '<?php echo system_session::getId();?>',
		upload_flash_url: '<?php echo $this->baseUrl('/swfupload.swf');?>',
		upload_post_url: '<?php echo $this->url('picture/swfupload/index');?>'
	};
	_upload.swfu.file_types = '<?php echo '*.' . implode(';*.', resource_config_image::getExtensions());?>';
	_upload.initialize();
});
<?php $this->headScript()->captureEnd();?>
<div class="body">
	<table class="form">
		<tr>
			<th style="width:280px"><?php echo $this->language('Upload In Batches');?>:</th>
			<th style="width:260px"><?php echo $this->language('Watermark Options');?></th>
			<th><?php echo $this->language('Upload Preview');?></th>
		</tr>
		<tr>
			<td>
				<span style="float:left;"><code id="spanButtonPlaceHolder"></code></span>
				<span class="hidden" style="float:left;padding-top:2px;" id="spanButtonUpload"><button type="button" name="upload" style="margin:0;" onclick="_upload.doUpload();"><?php echo $this->language('UPLOAD');?>»</button></span>
				<span class="hidden" style="float:left;padding-top:2px;" id="spanButtonStop"><button type="button" name="upload" style="margin:0;" onclick="_upload.doStop();"><?php echo $this->language('STOP');?>»</button></span>
				<span class="hidden" style="float:left;padding-top:2px;" id="spanButtonNextStep"><button type="submit" name="next" value="1" style="margin:0;"><?php echo $this->language('NEXT');?>»</button></span>
				<table class="no-border form">
					<tr>
						<td>
							<fieldset class="opt">
							<legend>&nbsp;&nbsp;<?php echo $this->language('Upload Options');?>&nbsp;&nbsp;</legend>
							<ul>
								<li>
									<?php echo $this->form()->checkbox('setting[cutting_title]', '1', array('checked' => 'checked', 'id' => 'setCuttingTitle'));?>
									<label class="for-checkbox" for="setCuttingTitle"><?php echo $this->language('Save file name as Title without extension');?>.</label>
								</li>
								<li>
									<?php echo $this->form()->checkbox('setting[insert_new]', '1', array('checked' => 'checked', 'id' => 'setUpdateExisting'));?>
									<label class="for-checkbox" for="setUpdateExisting"><?php echo $this->language('Insert New Photo if it is Existing');?>.</label>
									<code style="color:red;padding-left:1.8em;"><?php echo $this->language('If the Photo is alreay existing,but not the same Title or Description,please check it.');?>.</code>
								</li>
								<li>
									<?php echo $this->form()->checkbox('setting[return_information]', '1', array('id' => 'setReturnInformation'));?>
									<label class="for-checkbox" for="setReturnInformation"><?php echo $this->language('Return the Information if it is Existing');?>.</label>
									<code style="color:red;padding-left:1.8em;"><?php echo $this->language('Carefully');?>:<?php echo $this->language('original photo information will be changed');?>.</code>
								</li>
								<li>
									<?php echo $this->form()->checkbox('setting[allow_d_standard]', '1', array('checked' => 'checked', 'id' => 'setAllowDStandard'));?>
									<label class="for-checkbox" for="setAllowDStandard"><?php echo $this->language('Follow the standard of size setting');?>.</label>
									<code style="padding-left:1.8em;"><?php echo $this->language('The uploaded Photos must be strictly in line with the standard of size setting');?>.</code>
								</li>
								<li>
									<strong><?php echo $this->language('BELONGS TO SPECIAL');?></strong>(<em class="red"><?php echo $this->language('Latest 10 items');?></em>):
									<ul class="citem"><?php
									$str = '';
									foreach((array) $this->specialList AS $special) {
										$checked = false;
										if($this->special_id == $special->getId()) {
											$checked = ' checked="checked';
										}
										$str .= '<li' . ($checked ? ' style="color:blue;"' : '') . '>';
										$str .= '<input type="checkbox" name="special_id[' . $special->getId() . ']" id="special_id-' . $special->getId() . '" value="' . $special->getId() . '"' . $checked .' />';
										$str .= '<label class="for-checkbox" for="special_id-' . $special->getId() . '">' . htmlspecialchars($special->getTitle()) . '(<em class="gray">ID:' . $special->getId() . '</em>)</label>';
										$str .= '</li>';
									}
									echo $str;
									?></ul>
								</li>
							</ul>
							<div class="clear"></div>
							</fieldset>
						</td>
					</tr>
				</table>
				<hr class="clear"/>
				<table class="no-border list" id="file-queued">
					<tr>
						<th class="narrow">#</th>
						<th>NAME</th>
						<th class="narrow right">SIZE</th>
						<th class="id"></th>
					</tr>
				</table>
				<hr/>
				<table class="no-border">
					<tr>
						<th class="right">Queued: <em class="red" id="queued-number">0</em></th>
						<th class="id"></th>
					</tr>
				</table>
			</td>
			<td><?php echo $this->render('picture/_inc/watermarkOptions.phtml');?></td>
			<td class="nohover" id="preview"></td>
		</tr>
	</table>
</div>
<?php } ?>

<?php
if($this->step == 1) {
	echo $this->render('picture/_inc/batchEdit.phtml');
}
?>
</form>
